package cn.itcast.test;


import cn.itcast.domain.cargo.ContractExample;
import cn.itcast.domain.cargo.Factory;
import cn.itcast.domain.cargo.FactoryExample;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.List;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:spring/applicationContext-dao.xml")
public class CargoTset {
  /*  @Autowired
    private FactoryDao factoryDao;
    @Test
    public void Factory(){
        Factory factory = factoryDao.selectByPrimaryKey("1");
        System.out.println(factory);
    }

    //条件查询
    @Test
    public void findAll(){
        //构造条件对象
        FactoryExample example = new FactoryExample();
        //添加条件
        FactoryExample.Criteria criteria = example.createCriteria();
        //根据fanctoryname查询
       // criteria.andFactoryNameEqualTo("祁县晶晨厂");
        //模糊查询
        criteria.andFactoryNameLike("%祁县%");
        List<Factory> factories = factoryDao.selectByExample(example);


        System.out.println(factories);
    }*/
}
